package br.poli.ecomp.sma.massim.agent;

import jason.asSemantics.Agent;
import jason.asSemantics.Event;
import jason.asSemantics.Unifier;
import jason.asSyntax.Trigger;

import java.util.Queue;

public class EcompAgent extends Agent {

	private Trigger t = Trigger.parseTrigger("+cow(_,_,_)");
	private Unifier un = new Unifier();
	
	@Override
	public Event selectEvent(Queue<Event> events) {
		for (Event event : events) {
			if (un.unifies(t, event.getTrigger())) {
				return event;
			}
		}
		
		return super.selectEvent(events);
	}
	
}
